.class public Lcom/bigtincan/android/adfree/UpdateCheck;
.super Landroid/content/BroadcastReceiver;
.source "UpdateCheck.java"


# static fields
.field private static common:Lcom/bigtincan/android/adfree/Common;

.field private static context:Landroid/content/Context;

.field private static mNotificationManager:Landroid/app/NotificationManager;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 10
    invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V

    return-void
.end method

.method static synthetic access$0()Lcom/bigtincan/android/adfree/Common;
    .locals 1

    .prologue
    .line 14
    sget-object v0, Lcom/bigtincan/android/adfree/UpdateCheck;->common:Lcom/bigtincan/android/adfree/Common;

    return-object v0
.end method

.method static synthetic access$1()Landroid/content/Context;
    .locals 1

    .prologue
    .line 13
    sget-object v0, Lcom/bigtincan/android/adfree/UpdateCheck;->context:Landroid/content/Context;

    return-object v0
.end method

.method static synthetic access$2(Landroid/app/NotificationManager;)V
    .locals 0
    .parameter

    .prologue
    .line 12
    sput-object p0, Lcom/bigtincan/android/adfree/UpdateCheck;->mNotificationManager:Landroid/app/NotificationManager;

    return-void
.end method

.method static synthetic access$3(Lcom/bigtincan/android/adfree/UpdateCheck;IIIZ)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 71
    invoke-direct {p0, p1, p2, p3, p4}, Lcom/bigtincan/android/adfree/UpdateCheck;->showNotification(IIIZ)V

    return-void
.end method

.method private showNotification(IIIZ)V
    .locals 8
    .parameter "statusBarIconID"
    .parameter "statusBarTextID"
    .parameter "detailedTextID"
    .parameter "showIconOnly"

    .prologue
    const/4 v7, 0x0

    .line 74
    sget-object v3, Lcom/bigtincan/android/adfree/UpdateCheck;->context:Landroid/content/Context;

    .line 75
    new-instance v4, Landroid/content/Intent;

    sget-object v5, Lcom/bigtincan/android/adfree/UpdateCheck;->context:Landroid/content/Context;

    const-class v6, Lcom/bigtincan/android/adfree/DoUpgrade;

    invoke-direct {v4, v5, v6}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 74
    invoke-static {v3, v7, v4, v7}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    .line 78
    .local v0, contentIntent:Landroid/app/PendingIntent;
    if-eqz p4, :cond_0

    const/4 v3, 0x0

    move-object v2, v3

    .line 80
    .local v2, tickerText:Ljava/lang/String;
    :goto_0
    new-instance v1, Landroid/app/Notification;

    .line 83
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

    .line 80
    invoke-direct {v1, p1, v2, v3, v4}, Landroid/app/Notification;-><init>(ILjava/lang/CharSequence;J)V

    .line 86
    .local v1, notification:Landroid/app/Notification;
    sget-object v3, Lcom/bigtincan/android/adfree/UpdateCheck;->context:Landroid/content/Context;

    .line 87
    sget-object v4, Lcom/bigtincan/android/adfree/UpdateCheck;->context:Landroid/content/Context;

    invoke-virtual {v4, p2}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object v4

    .line 88
    sget-object v5, Lcom/bigtincan/android/adfree/UpdateCheck;->context:Landroid/content/Context;

    invoke-virtual {v5, p3}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;

    move-result-object v5

    .line 85
    invoke-virtual {v1, v3, v4, v5, v0}, Landroid/app/Notification;->setLatestEventInfo(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;)V

    .line 91
    sget-object v3, Lcom/bigtincan/android/adfree/UpdateCheck;->mNotificationManager:Landroid/app/NotificationManager;

    const/high16 v4, 0x7f04

    invoke-virtual {v3, v4, v1}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    .line 92
    return-void

    .line 78
    .end local v1           #notification:Landroid/app/Notification;
    .end local v2           #tickerText:Ljava/lang/String;
    :cond_0
    sget-object v3, Lcom/bigtincan/android/adfree/UpdateCheck;->context:Landroid/content/Context;

    invoke-virtual {v3, p2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    move-object v2, v3

    goto :goto_0
.end method


# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
    .locals 3
    .parameter "c"
    .parameter "i"

    .prologue
    .line 19
    const-string v1, "UpdateCheck.java started."

    invoke-static {v1}, Lcom/bigtincan/android/adfree/Common;->LogMessage(Ljava/lang/String;)V

    .line 20
    if-nez p1, :cond_0

    .line 22
    const-string v1, "UpdateCheck.java failed, c == null"

    invoke-static {v1}, Lcom/bigtincan/android/adfree/Common;->LogMessage(Ljava/lang/String;)V

    .line 69
    :goto_0
    return-void

    .line 26
    :cond_0
    sput-object p1, Lcom/bigtincan/android/adfree/UpdateCheck;->context:Landroid/content/Context;

    .line 27
    new-instance v1, Lcom/bigtincan/android/adfree/Common;

    sget-object v2, Lcom/bigtincan/android/adfree/UpdateCheck;->context:Landroid/content/Context;

    invoke-direct {v1, v2}, Lcom/bigtincan/android/adfree/Common;-><init>(Landroid/content/Context;)V

    sput-object v1, Lcom/bigtincan/android/adfree/UpdateCheck;->common:Lcom/bigtincan/android/adfree/Common;

    .line 29
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/bigtincan/android/adfree/UpdateCheck$1;

    invoke-direct {v1, p0}, Lcom/bigtincan/android/adfree/UpdateCheck$1;-><init>(Lcom/bigtincan/android/adfree/UpdateCheck;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 68
    .local v0, t:Ljava/lang/Thread;
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    goto :goto_0
.end method
